import {Component, ViewChild} from '@angular/core';

import { NavController, NavParams ,ModalController } from 'ionic-angular';

import {Platform} from 'ionic-angular';

import {BackButtonService} from '../../providers/backButtonService';


import {IonicPage, Tabs} from "ionic-angular";

@IonicPage()
@Component({
  templateUrl: 'tabs.html'
})
export class TabsPage {

  @ViewChild('mainTabs') tabs: Tabs;

  tab1Root = 'TabsHomePage';
  tab2Root = 'TabsTaskPage';
  tab3Root = 'TabsCustPage';

  constructor(private platform: Platform,
              public navCtrl: NavController,
              private backButtonService: BackButtonService) {
    //注册后退按钮事件
    platform.ready().then(() => {
      this.backButtonService.registerBackButtonAction(this.tabs);
    });

  }

  //跳转到页面
  toPage(pageName: any) {
    this.navCtrl.push(pageName, {
    });
  }

}
